The invention relates to a method of transcoding an input coded signal comprising the steps of:
decoding the input coded signal leading to a decoded quantized signal,
dequantizing the decoded quantized signal leading to a decoded signal,
requantizing a compensated signal leading to a requantized signal,
reencoding the requantized signal leading to a reencoded signal,
compensating a drift introduced in the reencoded signal by said requantization step, said compensation step being performed between said dequantizing and requantizing steps.
The invention also relates to a transcoder for carrying out said method.
The invention may be used, for example, for the transcoding of an MPEG-compressed signal of a given bit rate into another MPEG-compressed signal of a lower bit rate.
A transcoder may convert a compressed signal of a given bit rate into a compressed signal of a lower bit rate. Basically, a transcoder used for such a purpose consists of a cascaded decoder and encoder. This combination is rather complex and this complexity can be significantly reduced. In the particular case of video signals, some other aspects have to be taken into account. A coded video signal consists of a succession of encoded frames, where each frame is subdivided into a two-dimensional array of macroblocks, each macroblock being composed of blocks. A frame may be in the spatial domain, which is the pixel domain, and is transmitted in the frequency or transform domain, which results from a Discrete Cosine Transform (DCT) of the frame in the spatial domain. Besides, any frame may be separated into two fields: the top field formed by the odd lines of the frame and the bottom field formed by the even lines of the frame. A macroblock may be conveyed in two different formats: an interlaced format, hereinafter referred to as frame format, and a de-interlaced format, hereinafter referred to as field format. In the frame format, a macroblock is composed of lines from the two fields alternately and each DCT-block of the macroblock is formed by data from the two fields. In the field format, a macroblock is composed of lines from the two fields, and each DCT-block of the macroblock is formed by data from only one of the two fields.
A possible transcoder for carrying out a method of transcoding such as described in the introduction is proposed by Assuncao et al., IEEE Trans. on CSVT, vol. 8, no. 8, December 1998. This paper discloses a particular transcoder dedicated to MPEG-2 video signals. A transcoder 1 according to the prior art, such as shown in FIG. 1, comprises a decoding part and a subsequent coding part with motion compensation. The decoding part is composed of a variable length decoder VLD and a dequantizer IQ1. The coding part is composed of a quantizer Q2, a drift compensation loop DCL and a variable length encoder VLC. Quantization by Q2 introduces an error macroblock E or drift for each decoded macroblock F to be quantized into the transcoding path of the transcoder 1. This error macroblock E is derived in the drift compensation loop DCL as follows. The error macroblock E is derived at the output of a tap adder S2 as the difference between a compensated macroblock to be quantized provided to Q2 and a dequantized macroblock issuing from a dequantizer IQ2. This error macroblock E may be provided either in the frame or in the field format. In the latter case, the macroblock is converted into the frame format in a field/frame converter f/F. The error macroblock is then stored in the frame format in a memory unit MEM with all the other error macroblocks corresponding to the same frame. Thus the error macroblocks of the entire frame are stored in the memory unit MEM, and so are the error macroblocks of the previously transmitted frame. All these stored macroblocks may be used as references for the prediction by motion compensation of the decoded macroblock F in a MC-DCT unit. A prediction macroblock of the decoded macroblock F is finally obtained and added to the decoded macroblock F in a tap adder S1, resulting in a compensated decoded macroblock passed through Q2 for quantization.
The transcoder described by the prior art includes a drift compensation loop performing motion compensation exclusively on macroblocks in the frame format. The transcoder comprises a field/frame converter located separately from the motion compensation unit and upstream of the memory unit, so that the macroblocks may be stored in the frame format. The method of transcoding carried out in this transcoder involves many separate operations which are time consuming and which result in a complex hardware implementation.
It is an object of the invention to provide a method of transcoding which involves a reduced number of operations for time efficiency and leads to a simple hardware implementation of a transcoder for carrying out the method.
According to the invention, therefore, the drift compensation step of a method of transcoding such as described in the introduction comprises at least the consecutive sub-steps of:
deriving an error signal corresponding to said drift,
deriving a prediction signal of the decoded signal by means of a simultaneous motion compensation and field/frame conversion based on the error signal and adapted to the interlaced or non-interlaced transmission mode of the error signal and of the prediction signal,
subtracting the derived prediction signal from the decoded signal, leading to the compensated signal to be requantized.
The drift compensation step of a method according to the invention comprises a motion compensation combined with field/frame conversion. The field/frame conversion operation mentioned here concerns a conversion from the field format into the frame format as well as a conversion from the frame format into the field format. In fact, the error macroblock resulting from quantization is stored in the format in which it was provided without any necessary prior conversion into the frame or field format. The motion compensation operation may be performed indiscriminately on a macroblock in the field format or on a macroblock in the frame format. Similarly, the motion compensation operation may provide indiscriminately a macroblock in the field format or a macroblock in the frame format. Besides, the motion compensation step is performed on the basis of frames stored in the memory unit, whose macroblocks can either be stored in the frame format or in the field format. Thus the field/frame conversion operation is performed simultaneously with the motion compensation, depending on whether a field or a frame format is required for the input and output macroblocks. The combined motion compensation and field/frame conversion step may be considered as an adaptive motion compensation step.
An advantage of the present invention is therefore a reduction in the number of operations and thus the cost as compared with the prior art. Involved operations in the invention are combined, and as a result a hardware implementation of the method according to the invention is simplified.
In an embodiment of the invention, the adaptive motion compensation step is carried out on frames in the transform domain. An advantage of transcoding frames in the transform domain is memory reduction.
Furthermore, the invention also relates to a transcoder for carrying out a method in accordance with the invention.